Skip to main content

Read Mail

AutomatR.Office365.Activities.ReadMail

The "Read Mail" activity in AutomatR is part of the Office 365 activities package, enabling automation workflows to fetch and process emails from a specified Office 365 account. This activity utilizes the Microsoft Office message API to retrieve email messages based on specified criteria.

Properties

NameDescription
Input
BodySpecifies the body of the email you want to read. String variables containing the body content of the email.
FromSpecifies the email ID of the sender for the email you want to read. String variables containing the email ID.
Has AttachmentsSpecifies whether the email should have attachments. Boolean variables indicating whether the email should have attachments.
SubjectSpecifies the subject line of the email you want to read. String variables containing the subject of the email.
TopSpecifies the number of top emails to retrieve. Integer variables containing the number of top emails.
UnRead OnlySpecifies whether to retrieve only unread emails. Boolean variables indicating whether to retrieve only unread emails.
Misc
Display NameProvides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variables containing the desired display name.
Optional
DelaySpecifies the amount of time (in seconds) to wait before executing the "Read Mail" activity. This can be useful for handling synchronization issues. Integer variables containing the delay duration. Ex.: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1.
Output
MessagesOutputs the result as a List of Mail Messages, enabling you to use it for further activities. Variables of type List<MailMessage> to store the retrieved email messages.

How to use:

  1. Drag and drop the "Read Mail" activity onto the workflow.
  2. Configure the properties by specifying the criteria such as subject, body, sender email, etc., for filtering the emails.
  3. Optionally, configure the delay and customize the display name.
  4. Execute the workflow to fetch the specified emails based on the criteria.

Example: Consider an example where the "Read Mail" activity is used to retrieve the top 5 unread emails with attachments:

Read Mail:
Display Name: "Read Unread Emails with Attachments"
Top: 5
UnRead Only: True
Has Attachments: True
(Other Criteria as needed)
Messages: retrievedEmails

In this example, the activity fetches the top 5 unread emails with attachments based on the specified criteria. The retrieved emails are stored in the retrievedEmails variable of type List<MailMessage> for further processing in the workflow.